package xyz.wanwanwan.www.hrm.sender;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import xyz.wanwanwan.www.hrm.RabbitMQApplication;
import xyz.wanwanwan.www.hrm.config.RabbitmqConfig;


@SpringBootTest(classes = RabbitMQApplication.class)
@RunWith(SpringRunner.class)
public class SenderTest {
    @Autowired
    private RabbitTemplate template;
    @Test
    public void testSender(){
        String message = "这是一条令人毛骨悚然的信息";
        template.convertAndSend(RabbitmqConfig.EXCHANGE_TOPICS_INFORM,
                "email.hhwn",message);
    }

}
